package com.example.combwyaq.mvp.model;


import com.example.combwyaq.entity.TokenEntity;
import com.example.combwyaq.http.Api;
import com.example.combwyaq.http.HttpFactory;
import com.example.combwyaq.http.HttpType;
import com.example.combwyaq.mvp.ChangeFuncation;
import com.example.combwyaq.mvp.contract.SplashContract;
import com.example.combwyaq.mvp.model.entity.BaseEntity;

import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;

public class SplashModel extends BaseModel implements SplashContract.ISplashModel {
    @Inject
    public SplashModel(){}


    /*被观察着*/
    @Override
    public Observable<BaseEntity> requestToken(Map<String, Object> map) {
            Observable<TokenEntity> ob = HttpFactory.getInstance().factory(HttpType.SIGNTYPE)
                .getRetrofit().create(Api.class).requestToken(createBody(map));
        return ob.map(new ChangeFuncation<TokenEntity>());
    }
}
